package org.yzz.base.exception;

/**
 * 业务类的异常 和 系统已知的异常
 */
public class BusinessException extends RuntimeException{

    private ResponseCode responseCode;
    private Integer code;
    public BusinessException(ResponseCode code) {
        super(code.getMessage());   // 覆盖掉 RuntimeException 的异常 message 信息
        this.code=code.getCode();
    }

    public BusinessException() {
        super();
    }

    public BusinessException(String message) {
        super(message);
    }

    public BusinessException(String message, Throwable cause) {
        super(message, cause);
    }

    public BusinessException(Throwable cause) {
        super(cause);
    }

    public Integer getCode() {
        return code;
    }
}
